import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:url_launcher/url_launcher.dart';
import 'dart:async';

class LeaderPhone extends StatelessWidget {
  final String leaderPhone;
  final String leaderImage;
  const LeaderPhone({ Key key, this.leaderPhone, this.leaderImage, String LeaderImage }) : super(key: key);


  @override
  Widget build(BuildContext context) {
    final String _url = 'tel:' + leaderPhone;
    // final String _url = 'https://flutter.cn';

    void _launchURL () async {
      await canLaunch(_url) ? await launch(_url) : throw 'Could not launch $_url';
    }

    return Padding(
      padding: EdgeInsets.symmetric(vertical: 10.0, horizontal: 10.0),
      child: InkWell(
        child: Image.network(this.leaderImage),
        onTap: _launchURL
      ),
    );
  }
}